package lg.minecraft.plugin.worldprotect.util;

import lg.minecraft.plugin.worldprotect.WorldSettingType;
import lombok.Getter;
import lombok.Setter;

import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

@Setter
@Getter
public class WorldSettings {

    private final Set<WorldSettingType> worldSettings = new HashSet<>();
    private final String worldName;

    public WorldSettings(String worldName) {
        this.worldName = worldName;
    }

    public boolean isEnabled(WorldSettingType setting) {
        return worldSettings.contains(setting);
    }

    public void enable(WorldSettingType setting) {
        worldSettings.add(setting);
    }

    public void enableAll() {
        Collections.addAll(worldSettings, WorldSettingType.values());
    }

    public void disable(WorldSettingType setting) {
        worldSettings.remove(setting);
    }

    public void disableAll() {
        worldSettings.clear();
    }

}
